﻿using System;
using System.Collections.Specialized;


class PrimeFactor
{
    static void Main(string[] args)
    {
        int num = Convert.ToInt32(Console.ReadLine());

        //遍历所有比他小的数，输出既是其因子也是素数的数字
        for (int i = 2; i <= num; i++)
        {

            if (num % i == 0 && Is_Prime(i))
                Console.Write(i + " ");
        }

    }

    static bool Is_Prime(int n)
    {
        for (int i = 2; i < n; i++)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
}

